package com.xinli.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinli.business.domain.TOrderRefund;
import com.xinli.business.mapper.TOrderRefundMapper;
import com.xinli.business.service.ITOrderRefundService;
import com.xinli.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 订单售后原因Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-18
 */
@Service
public class TOrderRefundServiceImpl extends ServiceImpl<TOrderRefundMapper, TOrderRefund>  implements ITOrderRefundService
{
    @Autowired
    private TOrderRefundMapper tOrderRefundMapper;

    /**
     * 查询订单售后原因
     *
     * @param id 订单售后原因主键
     * @return 订单售后原因
     */
    @Override
    public TOrderRefund selectTOrderRefundById(String id)
    {
        return tOrderRefundMapper.selectTOrderRefundById(id);
    }

    /**
     * 查询订单售后原因列表
     *
     * @param tOrderRefund 订单售后原因
     * @return 订单售后原因
     */
    @Override
    public List<TOrderRefund> selectTOrderRefundList(TOrderRefund tOrderRefund)
    {
        return tOrderRefundMapper.selectTOrderRefundList(tOrderRefund);
    }

    /**
     * 新增订单售后原因
     *
     * @param tOrderRefund 订单售后原因
     * @return 结果
     */
    @Override
    public int insertTOrderRefund(TOrderRefund tOrderRefund)
    {
                tOrderRefund.setCreateTime(DateUtils.getNowDate());
            return tOrderRefundMapper.insertTOrderRefund(tOrderRefund);
    }

    /**
     * 修改订单售后原因
     *
     * @param tOrderRefund 订单售后原因
     * @return 结果
     */
    @Override
    public int updateTOrderRefund(TOrderRefund tOrderRefund)
    {
                tOrderRefund.setUpdateTime(DateUtils.getNowDate());
        return tOrderRefundMapper.updateTOrderRefund(tOrderRefund);
    }

    /**
     * 批量删除订单售后原因
     *
     * @param ids 需要删除的订单售后原因主键
     * @return 结果
     */
    @Override
    public int deleteTOrderRefundByIds(String[] ids)
    {
        return tOrderRefundMapper.deleteTOrderRefundByIds(ids);
    }

    /**
     * 删除订单售后原因信息
     *
     * @param id 订单售后原因主键
     * @return 结果
     */
    @Override
    public int deleteTOrderRefundById(String id)
    {
        return tOrderRefundMapper.deleteTOrderRefundById(id);
    }
}
